package com.xs.daoimpl;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.xs.bean.MajorBean;
import com.xs.bean.VideoTableBean;
import com.xs.dao.MajorDao;
import com.xs.util.JdbcUtil;



public class MajorDaoImpl extends JdbcUtil implements MajorDao {

	//获取所有专业
	@Override
	public List getMajorInfo() {
		String sql="select *  from  major_tb";
		ResultSet  rs=this.query(sql);
		List  list=new ArrayList();
		try {
			while(rs.next()) {
				 MajorBean  m=new MajorBean(rs.getInt(1),rs.getString(2));
				 list.add(m);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return list;
	}
}
